package com.example.demo.mapper;

import com.example.demo.domain.entity.Problem;
import com.example.demo.domain.entity.ProblemType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProblemMapper {

    /*获取题库*/
    List<Problem> findAllProblems();

    @Select("SELECT * FROM voj_problem_categories WHERE problem_category_parent_id != 0")
    List<ProblemType> getProblemType();

    //根据试卷id查题库
    @Select("SELECT problem_id FROM t_paper_detail WHERE paper_id = #{id}")
    List<Integer> getProblemByPaper(@Param("id") int paper_id);


}
